import os
#parameter 
video_path="/home/lzh/Videos/600_frames.h264"
total_frames=600
width=1920
height=1080
ffmpeg_path='/home/lzh/lzh/code/publish_new/seirios_dev/ffmpeg/ffmpeg'
output_file=str(total_frames)+".yuv"

 
def decode_cmd(input_path,output_path,total_frames,width,height):
	decode_cmd = ffmpeg_path + " -y " + \
		"-i " + input_path  + " " \
        "-vcodec rawvideo "  + \
        "-s " + str(width)+"x"+str(height) + " " + \
        "-pix_fmt yuv420p "  + \
        "-vframes " + str(total_frames) + " " + \
        output_path

	print(decode_cmd)
	exit_code = os.system(decode_cmd)
	return exit_code

if __name__ == "__main__":
	exit_code = decode_cmd(video_path,output_file,total_frames,width,height)             
	assert(exit_code==0)
